package com.android.powerbankpad.bean;

import com.android.powerbankpad.config.Constants;
import com.ws.universal.tools.utils.AppUtils;
import com.ws.universal.tools.utils.CacheUtils;
import com.ws.universal.tools.utils.ScreenUtils;
import com.ws.universal.tools.utils.StringUtils;
import com.ws.universal.tools.utils.TimeDateUtils;

public class SocketBean {
    private String cmd;
    private String version;
    //设备序列号
    private String sn;
    //时间戳
    private String stamp;
    //类型：1横屏、2竖屏
    private int model;


    public SocketBean(String cmd) {
        stamp = StringUtils.getString(TimeDateUtils.getTimeStampSecond());
        sn = CacheUtils.getString(Constants.serial_number);
        version = AppUtils.getAppVersionName() + "";
        this.cmd = cmd;
        if (ScreenUtils.isPortrait()) {
            this.model = 2;
        } else {
            this.model = 1;
        }
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getStamp() {
        return stamp;
    }

    public void setStamp(String stamp) {
        this.stamp = stamp;
    }

    public int getModel() {
        return model;
    }

    public void setModel(int model) {
        this.model = model;
    }


    @Override
    public String toString() {
        return "{" +
                "cmd='" + cmd + '\'' +
                ", version='" + version + '\'' +
                ", sn='" + sn + '\'' +
                ", stamp='" + stamp + '\'' +
                ", model=" + model +
                '}';
    }
}
